﻿using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;
using Zero.UControl.Base.Helper;

namespace Zero.UControl.Demo.Views.Empty
{
    /// <summary>
    /// EmptyView.xaml 的交互逻辑
    /// </summary>
    public partial class EmptyView : Window
    {
        public EmptyView()
        {
            InitializeComponent();
        }

        /*
        Point fromPoint;
        bool isDragging = false;
        double minDelta = 0.5;
        private void SelectRect_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
        {
            isDragging = true;
            fromPoint = e.GetPosition(cvs);
            SelectRect.CaptureMouse();
        }

        private void SelectRect_MouseMove(object sender, MouseEventArgs e)
        {
            if (!isDragging) return;
            Point curPoint = e.GetPosition(cvs);
            double offsetX = curPoint.X - fromPoint.X;
            double offsetY = curPoint.Y - fromPoint.Y;
            if (Math.Abs(offsetX) < minDelta && Math.Abs(offsetY) < minDelta)
                return;
           
            double curX = Canvas.GetLeft(SelectRect) + offsetX;
            double curY = Canvas.GetTop(SelectRect) + offsetY;
            Debug.WriteLine($"offset x: {Canvas.GetLeft(SelectRect)},y: {Canvas.GetTop(SelectRect)}");

            Canvas.SetLeft(SelectRect,curX);
            Canvas.SetTop(SelectRect,curY);
            fromPoint = curPoint;
        }

        private void SelectRect_MouseLeftButtonUp(object sender, MouseButtonEventArgs e)
        {
            isDragging = false;
            SelectRect.ReleaseMouseCapture();
        }

        private void LogPoint(string msg,Point point)
        {
            Debug.WriteLine($"{msg},x: {point.X},y: {point.Y}");
        }
        */

        private void Button_Click(object sender, RoutedEventArgs e)
        {
            List<string> voices = SpeechHelper.GetInstalledVoices().ToList();
            cvList.ItemsSource = voices;
        }
    }
}
